https://slatedb.io logo
I might be able to swing you some
# general
p
I might be able to swing you some credits with https://buildkite.com/docs/pipelines/hosted-agents if you’re interested
c
Oh! Nice! I appreciate that. Since I’ve got stuff all configured with WarpStream and it only costs me a few bucks a month I’m going to leave as-is. But as we add more nightly tests, I might come bugging you 😝
Do you work for buildkite? πŸ€”
p
Yep
c
Nice! You guys looking at sl8 for something in particular?
p
Yeah, we ingest build logs in 100kb chunks and looking for a cheap and scalable way to ingest them into s3. Once a build is finished they need to be assembled and written out. But while the build is running we still need to render them in the UI and they can arrive out of order
c
Yep.. SlateDB should be pretty good for this...
IIRC, @jeromegn was playing with slatedb for something similar
p
They also recruited one of our best engineers!
I cleaned up my changes and made a PR https://github.com/slatedb/slatedb/pull/1056
j
oh, we did? haha, we don't recruit as far as I know! that said, I am sorry you lost one of your best πŸ™
we are big fans of Buildkite
I've been a client of yours for almost 10 years now
p
I say it in jest, Rian is a fantastic person and an outstanding debugger
c
πŸ‘‹ another buildkite-er here, also scouting out SlateDB (same use-case as @Patrick R mentioned). Cool to see Fly are exploring simular stuff! We miss Rian, but I'm also a Fly user for some non work stuff, and am a happy customer - so makes me happy to know he's involved!
I've been rambling a bunch on our Slack about SSTs and LSM Trees etc as ways we can batch the writes for the job log chunk buffer. One of the main historical wrinkles that we are stuck with (at least for now) we have is that the requests from the customer's CI runners to our log ingestion endpoints that can (and do) arrive out of order due to the way the agent sends them to the backend. I'd started down the path of sketching out how we could batch the writes as SSTs, store some metadata off to the side, and compact them into bigger objects async, K-Way-Merging etc, and realised that all I really wanted was a cost-effective, write optimised K/V store that can support random inserts and range-scans... hence turning up here!
Big fan of the "diskless" future 😺
c
Nice! Welcome
@catkins Your use case sounds pretty reasonable. IIUC, I think using keys that include a timeestamp suffix should be enough to get you properly sorted log lines.
Something like: put(k=::, v=);
c
we get a sequence number from the client already, so in the current implementation, we sort by that
c
then scan(from=::, to = From=:;);
c
the current implementation buffers in a sharded postgres database index on (roughly)
job_id:sequence_number
c
gotcha
so basically exactly what I described would work
c
yep, exactly 😁 that's what I was imagining
c
(note the from : and to ; .. the semicolon is just ascii + 1 to get the full range up to the next job)
We should probably make life easier and include a scan_prefix()... πŸ€”
Having to manually hack bytes is silly
we might already handle this with range stuff.. I haven't spent time with it in a while πŸ˜… Anyway.. tl;dr should work πŸ˜„
c
i've worked with GCP BigTable and DynamoDB and things a bunch in the past so I've done all the byte hacks before too 😁
a classic one on BigTable was implementing latest-first timeline kinda features using 1's complement of unix timestamps and tricks like that to force particular lexical sort orders
c
lexicographical sort ftw
Sounds like no issue for you anyway then πŸ™‚ Still I'm melting a glacier right now to see if my little llm buddy can come up with
scan_prefix
Ah, I think you can just do (a ..= a)
to do a scan prefix
actually no that's dumb nm πŸ˜›
BAD LLM BUDDY BAD!
"fix or you go to jail"
Ah neat we already have the "find next byte" helper I think..
c
the
:
->
;
trick is far from the grossest way of tackling it, but a
scan_prefix
method would defs be convenient!
the APIs there today pretty much cover all we need - the only real gap is no
delete_range
kinda operation (or I guess
delete_prefix
too πŸ˜‰ ), but thats all easy enough to implement in user-space, especially if we keep track of the max sequence id, then we can just build the WriteBatch without doing a read first
the other thing I was thinking about was the single-writer per db. we'd buffer the writes through kafka, so we can partition the topic by
job_id
, then have a slatedb writer / db per input partition type approach
(and something something distributed locking using s3 conditional writes to make sure we cleanly handle rebalances)
or put it behind an API
c
LLM buddy is hard at work in the matrix factory
Yea, we need to do this. Been discussing it a fair amount lately. Pierre (ZeroFS) has been pushing for it as well.
I think we'll need an RFC for it.. even if we end up copying pebble/rocksdb
Yea.. multi writer is farther off.. I'm curious about what would be acceptible. Do you need txns/snapshot isolation?
p
@catkins we can probably get away with one writer per topic, I think that'll give us enough throughput
c
haha I was ranting about this too with Pierre the other day. Just adding a slatedb-leadership package that does this. We have it totally built in our TransactionalObjectStore already
p
@criccomini nope, we'd use a partition key to ensure everything that needs those guarantees is in the same partition
c
@Patrick R That would require us to have a single process consuming all of the partitions in the topic though no?
p
Yeah, but I think we only need up to ~200mb/s at peak so it should be fine?
c
Hmm maybe
p
I'm trying to get some code going to do some benchmarking, but can't get the go bindings to work at all. It's not writing anything to disk :/
c
And use locking or something to ensure we only have one process per topic ? Thinking about HA and deployment etc
p
Ya, haven't thought that far ahead yet πŸ˜›
c
The go bindings are feeling more and more sus. @Victor Ordaz has been messing with them and finding some oddities as well. Though he at least is getting stuff on disk
@Patrick R are you using
main
or 0.9.2?
p
main
c
K
It's possible something with the settings is borked. Victor did some work there recently (check commit log to find it). You might try 0.9.2 and see if things work as expected
c
Live a little Pat, get Claude to whip you up some Ruby bindings using Magnus 😁
c
LMK what you find. Go must work properly. I am just .. not a gopher
p
I'd be happy to use Rust, but I think it's a bit too many innovation tokens for us right now πŸ˜›
c
Sadly I agree
We can also pop it behind an API, it just comes with the cross-AZ malarkey once we route requests to the correct writer
c
(btw.. I think we're due for some slatedb-go committers if y'all want to do some committing πŸ˜… )
k.. dinner.. my minion is still hard at work somewhere in us-east-1... I'll drop a pr for scan_prefix later hopefully
c
Legendary
If we can get our prototype working, I reckon you can definitely expect some PRs for the Go bindings πŸ˜‰
c
pats little buddy on head .. good job lil guy
c
Naww good robot
v
j
What’s your querying pattern for those logs? Do you need to query all logs or always just per step or per build?
c
Always per job